#

| Chapter 12 Job Control |

## 12.6 Notification When Jobs Change State

Normally, the shell tells you about changes to your background jobs whenever it prints its prompt. That is, when you do something that makes the shell give you a prompt, you'll get a message like:

>     [1]  + Stopped (tty input)   rm -r
>     %

This message tells you that the rm -r command, which you're running in the background, needs input; it has probably asked you whether or not to delete a read-only file, or something similar.

This default behavior is usually what you want. By waiting until it prints a prompt, the shell minimizes "damage" to your screen. If you want to be notified immediately when a job changes state, you should set the variable notify:

>     % set notify   ...C shell

>     $ set -o notify   ...bash

The drawback, of course, is that you may be analyzing a screenful of output that you've laboriously constructed, only to have that screen "destroyed" by a lot of messages from the shell. Therefore, most users prefer to leave notify off (`unset`). To stop all background output, use stty tostop (12.7).

- ML

12.5 System Overloaded? Try Stopping Some Jobs |  | 12.7 Stop Background Output with stty tostop